Public Class cls_NIveles
    Private Nivel1 As cls_Nivel
    Private Nivel2 As cls_Nivel
    Private Nivel3 As cls_Nivel
    Private Nivel4 As cls_Nivel
    Private Nivel5 As cls_Nivel
    Public Bloque As Integer = 9

    Sub New()

        Nivel1 = New cls_Nivel
        Nivel2 = New cls_Nivel
        Nivel3 = New cls_Nivel
        Nivel4 = New cls_Nivel
        Nivel5 = New cls_Nivel

        GeneraNiveles()

    End Sub

    Public Function ObtieneNivel(ByVal Lines As Integer) As cls_Nivel   

        Select Case Lines
            Case 0 To Bloque
                Return Nivel1
            Case (Bloque + 1) To ((Bloque + 1) + Bloque)
                Return Nivel2
            Case ((Bloque + 1) * 2) To (((Bloque + 1) * 2) + Bloque)
                Return Nivel3
            Case ((Bloque + 1) * 3) To (((Bloque + 1) * 3) + Bloque)
                Return Nivel4
            Case Is >= ((Bloque + 1) * 4)
                Return Nivel5
        End Select
        Return Nivel1

    End Function

    Private Sub GeneraNiveles()

        ' Nivel 1
        Nivel1.Nivel = 1
        Nivel1.Nombre = "Principiante"
        Nivel1.Velocidad = 1000
        Nivel1.Color.C1 = Color.CornflowerBlue
        Nivel1.Color.C2 = Color.RoyalBlue
        Nivel1.Color.C3 = Color.LightSteelBlue
        Nivel1.Pts.L1 = 100
        Nivel1.Pts.L2 = 250
        Nivel1.Pts.L3 = 400
        Nivel1.Pts.L4 = 800

        ' Nivel 2
        Nivel2.Nivel = 2
        Nivel2.Nombre = "Basico"
        Nivel2.Velocidad = 800
        Nivel2.Color.C1 = Color.Orange
        Nivel2.Color.C2 = Color.OrangeRed
        Nivel2.Color.C3 = Color.Khaki
        Nivel2.Pts.L1 = 150
        Nivel2.Pts.L2 = 350
        Nivel2.Pts.L3 = 500
        Nivel2.Pts.L4 = 1000

        ' Nivel 3
        Nivel3.Nivel = 3
        Nivel3.Nombre = "Intermedio"
        Nivel3.Velocidad = 600
        Nivel3.Color.C1 = Color.ForestGreen
        Nivel3.Color.C2 = Color.DarkGreen
        Nivel3.Color.C3 = Color.Chartreuse
        Nivel3.Pts.L1 = 200
        Nivel3.Pts.L2 = 450
        Nivel3.Pts.L3 = 650
        Nivel3.Pts.L4 = 1300

        ' Nivel 4
        Nivel4.Nivel = 4
        Nivel4.Nombre = "Avanzado"
        Nivel4.Velocidad = 400
        Nivel4.Color.C1 = Color.Yellow
        Nivel4.Color.C2 = Color.Silver
        Nivel4.Color.C3 = Color.Teal
        Nivel4.Pts.L1 = 400
        Nivel4.Pts.L2 = 900
        Nivel4.Pts.L3 = 1500
        Nivel4.Pts.L4 = 3000

        ' Nivel 5
        Nivel5.Nivel = 5
        Nivel5.Nombre = "Expertos"
        Nivel5.Velocidad = 200
        Nivel5.Color.C1 = Color.Red
        Nivel5.Color.C2 = Color.Maroon
        Nivel5.Color.C3 = Color.Salmon
        Nivel5.Pts.L1 = 400
        Nivel5.Pts.L2 = 900
        Nivel5.Pts.L3 = 1500
        Nivel5.Pts.L4 = 3000

    End Sub

End Class

Public Class cls_Nivel
    Public Nivel As Integer
    Public Nombre As String
    Public Velocidad As Integer
    Public Color As Fondo
    Public Pts As Lineas

    Public Structure Fondo
        Dim C1 As Color
        Dim C2 As Color
        Dim C3 As Color
    End Structure

    Public Structure Lineas
        Dim L1 As Integer
        Dim L2 As Integer
        Dim L3 As Integer
        Dim L4 As Integer
    End Structure

    Public Function ObtienePuntos(ByVal Lineas As Integer) As Integer

        Select Case Lineas
            Case 1 : Return Pts.L1
            Case 2 : Return Pts.L2
            Case 3 : Return Pts.L3
            Case 4 : Return Pts.L4
            Case Else : Return 0
        End Select

    End Function

End Class
